package com.example.demo;

import com.example.demo.config.NullvalueHandlerFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class DemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

    @Bean
    public FilterRegistrationBean<NullvalueHandlerFilter> testFilterRegistration() {

        FilterRegistrationBean<NullvalueHandlerFilter> registration = new FilterRegistrationBean<>(new NullvalueHandlerFilter());
        registration.addUrlPatterns("/*");
        registration.setName("testFilter");
        registration.setOrder(1);
        return registration;
    }

}
